rm(list = ls())
set.seed(1111)
library(MatchIt)
library(dplyr)
library(ggplot2)
library(haven)
library(stargazer)
library(tableone)
library(Hmisc)
library(cem)
library(Matching)
library(car)
library(Zelig)
library(RColorBrewer)
library(car)
library(arm)
setwd("~/Dropbox/AttorneyMainData")
data <- read_dta("Attorney.dta")
data$hysLaw <- car::recode(data$SchoolLawyerArgue,"'Harvard'=1;'Yale'=1;'Stanford'=1;'Columbia'=1;'Chicago'=1;else=0")
data$demPres <- car::recode(data$SGOrals,"'McCree'=1;'Lee'=0;'(Acting) Fried'=0;'Fried'=0;'(Acting) Bryson'=0;'Starr'=0;'Days'=1;'(Acting) Dellinger'=1;'Waxman'=1;'(Acting) Underwood'=0; 'Olson'=0;'(Acting) Clement'=0;'Clement'=0;'Garre'=0;'(Acting) Kneedler'=1;'Kagan'=1;'(Acting) Katyal'=1;'Verrilli'=1;'(Acting) Gershengorn'=1;'(Acting) Francisco'=1;'(Acting) Wall'=1; 'Francisco'=1")
##Bryson was acting for both Bush 1 and Reagan
data$demPres[data$SGOrals=="(Acting) Bryson" & data$term=="1992"] <- 1
##data$demPres <- car::recode(data$pres_inOffice,"'BObama'=1;'Bush1'=0;'Bush2'=0;'JCarter'=1;'RReagan'=0;'WClinton'=1;else=NA")
data$SGOralsCollapseF <- as.factor(data$SGOralsCollapse)
data$justiceNameF <- as.factor(data$justiceName)
data$ActingSGOrals <- as.numeric(factor(data$ActingSGOrals, ordered=F))-1
data$TopLawSchool <- as.numeric(factor(data$TopLawSchool, ordered=F))-1
data$DCFirm <- as.numeric(factor(data$DCFirm, ordered=F))-1
data$ClerkDummy <- as.numeric(factor(data$ClerkDummy, ordered=F))-1
data$OppPetOrResp <- as.numeric(factor(data$OppPetOrResp, ordered=F))-1
data$CriminalDummy <- as.numeric(factor(data$CriminalDummy, ordered=F))-1
data$CivLibDummy <- as.numeric(factor(data$CivLibDummy, ordered=F))-1
data$EconDummy <- as.numeric(factor(data$EconDummy, ordered=F))-1
data$Acela <- as.numeric(factor(data$Acela, ordered=F))-1
data$LawyerArgueOSG <- as.numeric(factor(data$LawyerArgueOSG, ordered=F))-1
data$GenderLawyerArgue <- as.numeric(factor(data$GenderLawyerArgue, ordered=F))-1
data$RaceLawyerArgue <- as.numeric(factor(data$RaceLawyerArgue, ordered=F))-1
data$IdeologyOppCounsel <- as.numeric(factor(data$IdeologyOppCounsel, ordered=F))-1
ctLevel <- subset(data, ct_level==1)
summary(data)
dim(data)

#######################
##dropping one justice

###JUSTICES
AMKennedy <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="AMKennedy"))
AMKennedy_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="AMKennedy"))
AScalia <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="AScalia"))
AScalia_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="AScalia"))
BRWhite <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="BRWhite"))
BRWhite_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="BRWhite"))
CThomas <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="CThomas"))
CThomas_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="CThomas"))
DHSouter <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="DHSouter"))
DHSouter_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="DHSouter"))
EKagan <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="EKagan"))
EKagan_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="EKagan"))
HABlackmun <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="HABlackmun"))
HABlackmun_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="HABlackmun"))
JGRoberts <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="JGRoberts"))
JGRoberts_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="JGRoberts"))
JPStevens <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="JPStevens"))
JPStevens_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="JPStevens"))
LFPowell <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="LFPowell"))
LFPowell_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="LFPowell"))
NMGorsuch <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="NMGorsuch"))
NMGorsuch_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="NMGorsuch"))
PStewart <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="PStewart"))
PStewart_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="PStewart"))
RBGinsburg <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="RBGinsburg"))
RBGinsburg_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="RBGinsburg"))
SAAlito <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="SAAlito"))
SAAlito_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="SAAlito"))
SDOConnor <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="SDOConnor"))
SDOConnor_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="SDOConnor"))
SGBreyer <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="SGBreyer"))
SGBreyer_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="SGBreyer"))
SSotomayor <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="SSotomayor"))
SSotomayor_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="SSotomayor"))
TMarshall <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="TMarshall"))
TMarshall_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="TMarshall"))
WEBurger <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="WEBurger"))
WEBurger_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="WEBurger"))
WHRehnquist <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="WHRehnquist"))
WHRehnquist_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="WHRehnquist"))
WJBrennan <- glm(JVote~PriorOral, family="binomial", data = subset(data,justiceName!="WJBrennan"))
WJBrennan_m <- glm(JVote~PriorOral+hysLaw+DCFirm+ClerkDummy+OppPetOrResp+IdeologyOppCounsel+demPres, family="binomial", data = subset(data,justiceName!="WJBrennan"))

##Naive
set.seed(12345)
dd <- data
aa <- sim(AMKennedy)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
AMKennedy_j <- treated-untreated

aa <- sim(AScalia)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
AScalia_j <- treated-untreated

aa <- sim(BRWhite)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
BRWhite_j <- treated-untreated

aa <- sim(CThomas)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
CThomas_j <- treated-untreated

aa <- sim(DHSouter)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
DHSouter_j <- treated-untreated

aa <- sim(EKagan)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
EKagan_j <- treated-untreated

aa <- sim(HABlackmun)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
HABlackmun_j <- treated-untreated

aa <- sim(JGRoberts)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
JGRoberts_j <- treated-untreated

aa <- sim(JPStevens)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
JPStevens_j <- treated-untreated

aa <- sim(LFPowell)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
LFPowell_j <- treated-untreated

aa <- sim(NMGorsuch)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
NMGorsuch_j <- treated-untreated

aa <- sim(PStewart)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
PStewart_j <- treated-untreated

aa <- sim(RBGinsburg)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
RBGinsburg_j <- treated-untreated

aa <- sim(SAAlito)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
SAAlito_j <- treated-untreated

aa <- sim(SDOConnor)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
SDOConnor_j <- treated-untreated

aa <- sim(SGBreyer)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
SGBreyer_j <- treated-untreated

aa <- sim(SSotomayor)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
SSotomayor_j <- treated-untreated

aa <- sim(TMarshall)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
TMarshall_j <- treated-untreated

aa <- sim(WEBurger)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
WEBurger_j <- treated-untreated

aa <- sim(WHRehnquist)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
WHRehnquist_j <- treated-untreated

aa <- sim(WJBrennan)
acoef <- coef(aa)
treated <- invlogit(acoef[,1] + acoef[,2]*1)
untreated <- invlogit(acoef[,1] + acoef[,2]*0)
WJBrennan_j <- treated-untreated


##Multivariate
dd <- data
aa <- sim(AMKennedy_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
AMKennedy_m_j <- treated-untreated

aa <- sim(AScalia_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
AScalia_m_j <- treated-untreated

aa <- sim(BRWhite_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
BRWhite_m_j <- treated-untreated

aa <- sim(CThomas_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
CThomas_m_j <- treated-untreated

aa <- sim(DHSouter_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
DHSouter_m_j <- treated-untreated

aa <- sim(EKagan_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
EKagan_m_j <- treated-untreated

aa <- sim(HABlackmun_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
HABlackmun_m_j <- treated-untreated

aa <- sim(JGRoberts_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
JGRoberts_m_j <- treated-untreated

aa <- sim(JPStevens_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
JPStevens_m_j <- treated-untreated

aa <- sim(LFPowell_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
LFPowell_m_j <- treated-untreated

aa <- sim(NMGorsuch_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
NMGorsuch_m_j <- treated-untreated

aa <- sim(PStewart_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
PStewart_m_j <- treated-untreated

aa <- sim(RBGinsburg_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
RBGinsburg_m_j <- treated-untreated

aa <- sim(SAAlito_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
SAAlito_m_j <- treated-untreated

aa <- sim(SDOConnor_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
SDOConnor_m_j <- treated-untreated

aa <- sim(SGBreyer_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
SGBreyer_m_j <- treated-untreated

aa <- sim(SSotomayor_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
SSotomayor_m_j <- treated-untreated

aa <- sim(TMarshall_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
TMarshall_m_j <- treated-untreated

aa <- sim(WEBurger_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
WEBurger_m_j <- treated-untreated

aa <- sim(WHRehnquist_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
WHRehnquist_m_j <- treated-untreated

aa <- sim(WJBrennan_m)
acoef <- coef(aa)
treated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*1 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
untreated <- invlogit(acoef[,"(Intercept)"] + acoef[,"PriorOral"]*0 + acoef[,"hysLaw"]*median(dd$hysLaw,na.omit=T) + acoef[,"DCFirm"]*median(dd$DCFirm,na.omit=T) + acoef[,"ClerkDummy"]*median(dd$ClerkDummy,na.omit=T) + acoef[,"OppPetOrResp"]*median(dd$OppPetOrResp,na.omit=T) + acoef[,"IdeologyOppCounsel"]*1  + acoef[,"demPres"]*0)
WJBrennan_m_j <- treated-untreated

###SI, Figure A4
pdf("DroppingJustice.pdf",width=9,height=6,paper='special') 
par(mar=c(5.1,2, 4.1, 2.1),mfrow=c(1,2),oma=c(0,5,0,0))
plot(NA,xlim=c(-.05,.15),ylim=c(.5,21.5),ylab="",xlab="ATT", main="Naive Models",yaxt="n")
axis(2, at=c(21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1),labels=c("Alito","Blackmun","Brennan","Breyer","Burger","Ginsburg","Gorsuch","Kagan","Kennedy","Marshall","O'Connor","Powell","Rehnquist","Roberts","Scalia","Sotomayor","Souter","Stevens","Stewart","Thomas","White"), las=2)
points(y=c(21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1),
       x=c(mean(SAAlito_j),
           mean(HABlackmun_j),
           mean(WJBrennan_j),
           mean(SGBreyer_j),
           mean(WEBurger_j),
           mean(RBGinsburg_j),
           mean(NMGorsuch_j),
           mean(EKagan_j),
           mean(AMKennedy_j),
           mean(TMarshall_j),
           mean(SDOConnor_j),
           mean(LFPowell_j),
           mean(WHRehnquist_j),
           mean(JGRoberts_j),
           mean(AScalia_j),
           mean(SSotomayor_j),
           mean(DHSouter_j),
           mean(JPStevens_j),
           mean(PStewart_j),
           mean(CThomas_j),
           mean(BRWhite_j)), pch=19,cex=1.05,col="gray70")
segments(y0=21,y1=21,x0=quantile(SAAlito_j,.025),x1=quantile(SAAlito_j,.975),lwd=2,col="gray70")
segments(y0=20,y1=20,x0=quantile(HABlackmun_j,.025),x1=quantile(HABlackmun_j,.975),lwd=2,col="gray70")
segments(y0=19,y1=19,x0=quantile(WJBrennan_j,.025),x1=quantile(WJBrennan_j),lwd=2,col="gray70")
segments(y0=18,y1=18,x0=quantile(SGBreyer_j,.025),x1=quantile(SGBreyer_j,.975),lwd=2,col="gray70")
segments(y0=17,y1=17,x0=quantile(WEBurger_j,.025),x1=quantile(WEBurger_j,.975),lwd=2,col="gray70")
segments(y0=16,y1=16,x0=quantile(RBGinsburg_j,.025),x1=quantile(RBGinsburg_j,.975),lwd=2,col="gray70")
segments(y0=15,y1=15,x0=quantile(NMGorsuch_j,.025),x1=quantile(NMGorsuch_j,.975),lwd=2,col="gray70")
segments(y0=14,y1=14,x0=quantile(EKagan_j,.025),x1=quantile(EKagan_j,.975),lwd=2,col="gray70")
segments(y0=13,y1=13,x0=quantile(AMKennedy_j,.025),x1=quantile(AMKennedy_j,.975),lwd=2,col="gray70")
segments(y0=12,y1=12,x0=quantile(TMarshall_j,.025),x1=quantile(TMarshall_j,.975),lwd=2,col="gray70")
segments(y0=11,y1=11,x0=quantile(SDOConnor_j,.025),x1=quantile(SDOConnor_j,.975),lwd=2,col="gray70")
segments(y0=10,y1=10,x0=quantile(LFPowell_j,.025),x1=quantile(LFPowell_j,.975),lwd=2,col="gray70")
segments(y0=9,y1=9,x0=quantile(WHRehnquist_j,.025),x1=quantile(WHRehnquist_j,.975),lwd=2,col="gray70")
segments(y0=8,y1=8,x0=quantile(JGRoberts_j,.025),x1=quantile(JGRoberts_j,.975),lwd=2,col="gray70")
segments(y0=7,y1=7,x0=quantile(AScalia_j,.025),x1=quantile(AScalia_j,.975),lwd=2,col="gray70")
segments(y0=6,y1=6,x0=quantile(SSotomayor_j,.025),x1=quantile(SSotomayor_j,.975),lwd=2,col="gray70")
segments(y0=5,y1=5,x0=quantile(DHSouter_j,.025),x1=quantile(DHSouter_j,.975),lwd=2,col="gray70")
segments(y0=4,y1=4,x0=quantile(JPStevens_j,.025),x1=quantile(JPStevens_j,.975),lwd=2,col="gray70")
segments(y0=3,y1=3,x0=quantile(PStewart_j,.025),x1=quantile(PStewart_j,.975),lwd=2,col="gray70")
segments(y0=2,y1=2,x0=quantile(CThomas_j,.025),x1=quantile(CThomas_j,.975),lwd=2,col="gray70")
segments(y0=1,y1=1,x0=quantile(BRWhite_j,.025),x1=quantile(BRWhite_j,.975),lwd=2,col="gray70")
abline(v=0,lwd=3,col="gray60")

#Unmatched Case-Level, Multivariate
#par(mar=c(5.1,7, 4.1, 2.1),mfrow=c(1,1))
plot(NA,xlim=c(-.05,.15),ylim=c(.5,21.5),ylab="",xlab="ATT", main="Multivariate Models",yaxt="n")
#axis(2, at=c(21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1),labels=c("AMKennedy","AScalia","BRWhite","CThomas","DHSouter","EKagan","HABlackmun","JGRoberts","JPStevens","LFPowell","NMGorsuch","PStewart","RBGinsburg","SAAlito","SDOConnor","SGBreyer","SSotomayor","TMarshall","WEBurger","WHRehnquist","WJBrennan"), las=2)
points(y=c(21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1),
       x=c(mean(SAAlito_m_j),
           mean(HABlackmun_m_j),
           mean(WJBrennan_m_j),
           mean(SGBreyer_m_j),
           mean(WEBurger_m_j),
           mean(RBGinsburg_m_j),
           mean(NMGorsuch_m_j),
           mean(EKagan_m_j),
           mean(AMKennedy_m_j),
           mean(TMarshall_m_j),
           mean(SDOConnor_m_j),
           mean(LFPowell_m_j),
           mean(WHRehnquist_m_j),
           mean(JGRoberts_m_j),
           mean(AScalia_m_j),
           mean(SSotomayor_m_j),
           mean(DHSouter_m_j),
           mean(JPStevens_m_j),
           mean(PStewart_m_j),
           mean(CThomas_m_j),
           mean(BRWhite_m_j)), pch=19,cex=1.05,col="gray70")
segments(y0=21,y1=21,x0=quantile(SAAlito_m_j,.025),x1=quantile(SAAlito_m_j,.975),lwd=2,col="gray70")
segments(y0=20,y1=20,x0=quantile(HABlackmun_m_j,.025),x1=quantile(HABlackmun_m_j,.975),lwd=2,col="gray70")
segments(y0=19,y1=19,x0=quantile(WJBrennan_m_j,.025),x1=quantile(WJBrennan_m_j),lwd=2,col="gray70")
segments(y0=18,y1=18,x0=quantile(SGBreyer_m_j,.025),x1=quantile(SGBreyer_m_j,.975),lwd=2,col="gray70")
segments(y0=17,y1=17,x0=quantile(WEBurger_m_j,.025),x1=quantile(WEBurger_m_j,.975),lwd=2,col="gray70")
segments(y0=16,y1=16,x0=quantile(RBGinsburg_m_j,.025),x1=quantile(RBGinsburg_m_j,.975),lwd=2,col="gray70")
segments(y0=15,y1=15,x0=quantile(NMGorsuch_m_j,.025),x1=quantile(NMGorsuch_m_j,.975),lwd=2,col="gray70")
segments(y0=14,y1=14,x0=quantile(EKagan_m_j,.025),x1=quantile(EKagan_m_j,.975),lwd=2,col="gray70")
segments(y0=13,y1=13,x0=quantile(AMKennedy_m_j,.025),x1=quantile(AMKennedy_m_j,.975),lwd=2,col="gray70")
segments(y0=12,y1=12,x0=quantile(TMarshall_m_j,.025),x1=quantile(TMarshall_m_j,.975),lwd=2,col="gray70")
segments(y0=11,y1=11,x0=quantile(SDOConnor_m_j,.025),x1=quantile(SDOConnor_m_j,.975),lwd=2,col="gray70")
segments(y0=10,y1=10,x0=quantile(LFPowell_m_j,.025),x1=quantile(LFPowell_m_j,.975),lwd=2,col="gray70")
segments(y0=9,y1=9,x0=quantile(WHRehnquist_m_j,.025),x1=quantile(WHRehnquist_m_j,.975),lwd=2,col="gray70")
segments(y0=8,y1=8,x0=quantile(JGRoberts_m_j,.025),x1=quantile(JGRoberts_m_j,.975),lwd=2,col="gray70")
segments(y0=7,y1=7,x0=quantile(AScalia_m_j,.025),x1=quantile(AScalia_m_j,.975),lwd=2,col="gray70")
segments(y0=6,y1=6,x0=quantile(SSotomayor_m_j,.025),x1=quantile(SSotomayor_m_j,.975),lwd=2,col="gray70")
segments(y0=5,y1=5,x0=quantile(DHSouter_m_j,.025),x1=quantile(DHSouter_m_j,.975),lwd=2,col="gray70")
segments(y0=4,y1=4,x0=quantile(JPStevens_m_j,.025),x1=quantile(JPStevens_m_j,.975),lwd=2,col="gray70")
segments(y0=3,y1=3,x0=quantile(PStewart_m_j,.025),x1=quantile(PStewart_m_j,.975),lwd=2,col="gray70")
segments(y0=2,y1=2,x0=quantile(CThomas_m_j,.025),x1=quantile(CThomas_m_j,.975),lwd=2,col="gray70")
segments(y0=1,y1=1,x0=quantile(BRWhite_m_j,.025),x1=quantile(BRWhite_m_j,.975),lwd=2,col="gray70")
abline(v=0,lwd=3,col="gray60")
dev.off()